package cn.itsource.pet.controller;

import cn.itsource.basic.util.AjaxResult;
import cn.itsource.basic.util.PageList;
import cn.itsource.org.domain.Employee;
import cn.itsource.pet.pojo.domain.SearchMasterMsg;
import cn.itsource.pet.pojo.dto.AuditDto;
import cn.itsource.pet.query.SearchMasterMsgQuery;
import cn.itsource.pet.service.SearchMasterMsgService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 接单管理
 */
@RestController
@RequestMapping("/searchMasterMsg")
public class SearchMasterMsgController {
    @Autowired
    private SearchMasterMsgService service;
    //    查询全部分页查询
    @PostMapping("pageList")
    @ApiOperation(value = "分页查询所有的部门")
    public PageList<SearchMasterMsg> findPageList(@RequestBody SearchMasterMsgQuery query){
        return service.findPageList(query);
    }
    /**
     * 审核接口
     */
    @PostMapping("/audit")
    public AjaxResult audit(@RequestBody AuditDto auditDto){
        AjaxResult audit = service.audit(auditDto);
        return audit;
    }
    /**
     * 查询员工接口
     */
    @PostMapping("/employeeInformation")
    public AjaxResult employeeInformation(){
        List<Employee> employees = service.employeeInformation();
        return AjaxResult.createSuccess(employees);

    }
}
